# Adjust nominal wage to real wage using CPI-U
# Not Seasonally Adjusted
# Area:         South urban
# Item:         All items
# Base Period:  1982-84=100


BEGIN {
  FS = ","
  OFS = ","
  while ((getline line < "/home/huizi/HOLA/research/green-jobs/data/IPDyr.csv") > 0) {
    split (line, x)
    year = x[1]
    IPD[year] = x[2]
  }
}

{
  if ($2 in IPD)
    print $1,$2,$3,$3*IPD[$2]/100
  else {
    print NR, $2, "Error"
    exit
  }
}
